// **************************************************************
// Com ++ Framework by the C++ World
// Please report defects: mailto:compp@cplusplusworld.com
// Please visit: http://www.cplusplusworld.com/socketlibrary.html
// **************************************************************

#ifndef COMEXCEPTION_H
#define COMEXCEPTION_H

#include <exception>
#include <string>
#include <iostream>
#include <errno.h>

namespace syspp {
  class ComException : public std::exception {
  public:
    
    ComException()throw(){}
    virtual ~ComException()throw(){}
    ComException(const  char * txt) throw() : Txt(txt) { }
    ComException(const ComException& ex) throw() { this->operator=(ex);	}
    ComException& operator=(const ComException& ex) throw() {
      Txt=ex.Txt;
      return *this;
    }
    virtual const char* what() const throw()   { return Txt.c_str();	}
    
  protected:
    /**
     * Set new message value
     */ 
    virtual void SetMessage(const char* txt) { this->Txt=txt; }
			
    /**
     * Retrieve a copy of a message value
     */ 
    virtual std::string GetText() const { return this->Txt;	}
			
  private:
    std::string Txt;
  };
};
#endif

